import { storage } from "../../../common/index";
Component({
  properties: {
    data: {
      type: Array,
      default: [],
    },
  },
  lifetimes: {
    attached: function () {
      this.storage = storage;
    },
  },
  methods: {
    errorImg() {
      console.log("-------------------->");
    },
    goToDetail(e) {
      const book = this.data.data.find(
        (item) => item.id === e.currentTarget.dataset.id
      );
      this.storage.data.currentBookDetail = book;
      wx.navigateTo({
        url: "/pages/detail/detail",
      });
    },
  },
});
